<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <title>Document</title>
</head>

<body>
    <div id="root">
        <form action="#" @submit.prevent="demo">
            <label for="demo">账号：</label>
            <input type="text" id="demo" v-model.trim="account">
            <br><br>
            <label for="pwd">密码：</label>
            <input type="password" id="pwd" v-model.trim="pwd">
            <br><br>
            <label for="age">年龄：</label>
            <input type="number" id="age" v-model.number="age">
            <br><br>
            性别：
            男 <input type="radio" name="sex" value="man" v-model="sex">
            女 <input type="radio" name="sex" value="woman" v-model="sex">
            <br><br>
            爱好：
            唱跳<input type="checkbox" name="hobby" value="sing" id="" v-model="hobby">
            rap<input type="checkbox" name="hobby" value="rap" id="" v-model="hobby">
            篮球<input type="checkbox" name="hobby" value="basketball" id="" v-model="hobby">
            <br><br>
            地区：
            <select name="district" id="" v-model="district">
                <option value="beijing">北京</option>
                <option value="shanghai">上海</option>
                <option value="shenzhen">深圳</option>
                <option value="chengdu">成都</option>
                <option value="wuhan">武汉</option>
            </select><br><br>
            其他信息<br><br>
            <textarea v-model.lazy="other" name="other" id="" cols="30" rows="10"></textarea>
            <br><br>
            <input type="checkbox" v-model="choose">
            阅读并接受 <a href="https://www.bilibili.com/">《用户协议》</a>
            <br><br>
            <button>提交</button>
            </select>
        </form>
    </div>

    <script>
        const vm = new Vue({
            el: "#root",
            data: {
                account: "",
                pwd: "",
                age:"",
                sex: "",
                hobby: [],
                district: "",
                other: "",
                choose: "",

            },
            methods: {
                demo() {
                    alert("请确认信息")
                    console.log(JSON.stringify(this._data))
                }
            }

        })

    </script>
</body>

</html>